package com.neolix.watch;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import java.io.Serializable;

import static android.view.Window.FEATURE_NO_TITLE;
import static com.neolix.watch.NeolixApplication.getInstance;

public class BaseActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(FEATURE_NO_TITLE);
    }

    public void goTo(Class<? extends Activity> clazz) {
        Intent intent = getIntent(clazz);
        startActivity(intent);
    }

    protected void goToNextWithBundle(Serializable serializable, Class<? extends Activity> clazz, String tag) {
        Intent intent = getIntent(clazz);
        intent.putExtra(tag, serializable);
        startActivity(intent);
    }

    private Intent getIntent(Class<? extends Activity> clazz) {
        return new Intent(getInstance(), clazz);
    }
}
